﻿<CodeSnippets
    xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>
        CommboBox
      </Title>
    </Header>
    <Snippet>
      <Declarations>
        <Literal>
          <ID>comboboxStyle</ID>
          <ToolTip>style of combobox</ToolTip>
          <Default>comboboxStyle</Default>
        </Literal>
        <Literal>
          <ID>name</ID>
          <ToolTip>name of combobox</ToolTip>
          <Default>name</Default>
        </Literal>
        <Literal>
          <ID>rowNumber</ID>
          <ToolTip>row number in table</ToolTip>
          <Default>rowNumber</Default>
        </Literal>

        <Literal>
          <ID>colNumber</ID>
          <ToolTip>column number in table</ToolTip>
          <Default>columnNumber</Default>
        </Literal>

        <Literal>
          <ID>colNumber+1</ID>
          <ToolTip>column number + 1 in table</ToolTip>
          <Default>columnNumber+1</Default>
        </Literal>

        <Literal>
          <ID>fieldID</ID>
          <ToolTip>field ID of item</ToolTip>
          <Default>fieldID</Default>
        </Literal>

        <Literal>
          <ID>listViewModelSource</ID>
          <ToolTip>list view model source</ToolTip>
          <Default>listViewModelSource</Default>
        </Literal>

        <Literal>
          <ID>viewModelSource</ID>
          <ToolTip>view model source</ToolTip>
          <Default>viewModelSource</Default>
        </Literal>

        <Literal>
          <ID>itemTemplate</ID>
          <ToolTip>template of item</ToolTip>
          <Default>itemTemplate</Default>
        </Literal>

        <Literal>
          <ID>fieldDisplay</ID>
          <ToolTip>field display of item</ToolTip>
          <Default>fieldDisplay</Default>
        </Literal>

      </Declarations>

      <Code Language="CSharp">
        <![CDATA[
        
  <telerik:RadComboBox x:Name="$name$"  Style="{StaticResource $comboboxStyle$}"  
    Grid.Row="$rowNumber$" Grid.Column="$colNumber$" KeyUp="ComboBox_KeyUp"
    ItemsSource="{Binding Source={StaticResource $listViewModelSource$}, Path=Model, Mode=TwoWay}" 
    ItemTemplate="{StaticResource itemTemplate}" SelectedValuePath="$fieldID$"  telerik:TextSearch.TextPath="$fieldDisplay$"                                                 
    SelectedValue="{Binding Source={StaticResource $viewModelSource$}, Path=Model.$fieldID$, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" />
				
        ]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
